/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package aitsm;

import java.sql.Connection;
import java.sql.DriverManager;

/**
 *
 * @author minh
 */
public class Config {
    Connection con = null;
    public String initConnection(){
        try {
            Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver").newInstance();
            String url = "jdbc:sqlserver://SMINH\\SQL2008; " + 
                    "databaseName = AITSM;" +
                    "username = sa; password = M1nhMinh";
            this.con = DriverManager.getConnection(url);
            if(this.con != null)
                return "Connect database ok";
            else
                return "Unable to connect database";
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        return null;
    }
}
